package domain;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: vladimir
 * Date: 09.08.11
 * Time: 23:30
 * To change this template use File | Settings | File Templates.
 */
public class Checker {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new FileReader("domains.txt"));
        String domain;
        while ((domain = reader.readLine()) != null) {
            Document document = Jsoup.connect("http://www.whois-pro.ru/?searchDomainName=" + domain + "&searchDomainExt=ru&formSubmit=Проверить+домен&doAction=checkDomains").get();
            System.out.println(document);
            Elements rows = document.select("tr");
            for (Element row : rows) {
                System.out.println(row.text());
            }

        }
    }
}
